Drop support for fifos and devices
authorColin Walters <walters@verbum.org>
Tue, 16 Jul 2013 13:35:44 +0000 (09:35 -0400)
committerColin Walters <walters@verbum.org>
Tue, 16 Jul 2013 13:35:44 +0000 (09:35 -0400)
While the first was useful way back in the day when we were importing
Debian bits and /sbin/init was expecting to find /dev/.initctl as a
named pipe, that's no longer an issue with systemd since it uses
dynamic Unix sockets.

Likewise, character and block devices in /dev are now dynamically
created by the devtmpfs from the kernel.

Less complexity and code here if we just support directories, regular
files, and symbolic links.

src/libostree/ostree-core.c
tests/libtest.sh

index 0749f04a90d786eb7c845179d14ef42f9c8ebc7e..99bc84da64a0d6abf0fe95ec986c7dc1a08d378e 100644 (file)
@@ -1117,14 +1117,6 @@ ostree_file_header_parse (GVariant         *metadata,
     {
       g_file_info_set_attribute_byte_string (ret_file_info, "standard::symlink-target", symlink_target);
     }
-  else if (S_ISCHR (mode) || S_ISBLK (mode))
-    {
-      g_file_info_set_attribute_uint32 (ret_file_info, "unix::rdev", rdev);
-    }
-  else if (S_ISFIFO (mode))
-    {
-      ;
-    }
   else
     {
       g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
@@ -1178,14 +1170,6 @@ ostree_zlib_file_header_parse (GVariant         *metadata,
     {
       g_file_info_set_attribute_byte_string (ret_file_info, "standard::symlink-target", symlink_target);
     }
-  else if (S_ISCHR (mode) || S_ISBLK (mode))
-    {
-      g_file_info_set_attribute_uint32 (ret_file_info, "unix::rdev", rdev);
-    }
-  else if (S_ISFIFO (mode))
-    {
-      ;
-    }
   else
     {
       g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
@@ -1259,23 +1243,6 @@ ostree_create_file_from_input (GFile            *dest_file,
           goto out;
         }
     }
-  else if (S_ISCHR (mode) || S_ISBLK (mode))
-    {
-      guint32 dev = g_file_info_get_attribute_uint32 (finfo, "unix::rdev");
-      if (mknod (dest_path, mode, dev) < 0)
-        {
-          ot_util_set_error_from_errno (error, errno);
-          goto out;
-        }
-    }
-  else if (S_ISFIFO (mode))
-    {
-      if (mkfifo (dest_path, mode) < 0)
-        {
-          ot_util_set_error_from_errno (error, errno);
-          goto out;
-        }
-    }
   else
     {
       g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
@@ -1625,11 +1592,7 @@ ostree_validate_structureof_file_mode (guint32            mode,
 {
   gboolean ret = FALSE;
 
-  if (!(S_ISREG (mode)
-        || S_ISLNK (mode)
-        || S_ISCHR (mode)
-        || S_ISBLK (mode)
-        || S_ISFIFO (mode)))
+  if (!(S_ISREG (mode) || S_ISLNK (mode)))
     {
       g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
                    "Invalid file metadata mode %u; not a valid file type", mode);
index e98dd65fa663d5f0ce7057b20ce66fff6a3fd71c..89d50b86abfd27f8e2f8ed9ec113908de710f5ba 100644 (file)
@@ -103,7 +103,6 @@ setup_test_repository () {
     $OSTREE commit -b test2 -s "Test Commit 1" -m "Commit body first"
 
     mkdir baz
-    mkfifo baz/afifo  # named pipe
     echo moo > baz/cow
     echo alien > baz/saucer
     mkdir baz/deeper